﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;

namespace Jet.Dal.EF.Tests.DataObjects
{
	/// <summary>
	/// Information about suppliers from Northwind database
	/// </summary>
	[DebuggerDisplay("{ProductID} - {ProductName}")]
	[Table("Products")]
	public class Products
	{
		[Key]
		public int ProductID { get; set; }

		[Column]
		public string ProductName { get; set; }

		[Column]
		public int SupplierID { get; set; }

		[ForeignKey("SupplierID")]
		public virtual Suppliers Supplier { get; set; }


		[Column]
		public int CategoryID { get; set; }

		[ForeignKey("CategoryID")]
		public virtual Categories Category { get; set; }


		[Column]
		public string QuantityPerUnit { get; set; }

		[Column]
		public decimal UnitPrice { get; set; }

		[Column]
		public Int16 UnitsInStock { get; set; }

		[Column]
		public Int16 UnitsOnOrder { get; set; }

		[Column]
		public Int16 ReorderLevel { get; set; }

		[Column]
		public bool Discontinued { get; set; }

		public virtual ICollection<OrderDetails> OrderDetails { get; set; }

		public override string ToString()
		{
			return String.Format("Product: id='{0}', name='{1}', price='{2}'", ProductID, ProductName, UnitPrice);
		}
	}
}
